<template>
  <div id="app">
   
    <router-view/>
    <!-- 底部导航 -->
    <van-tabbar v-model="active" route>
      <van-tabbar-item to="/home" icon="home-o">首页</van-tabbar-item>
      <van-tabbar-item to="/classfiy" icon="apps-o">分类</van-tabbar-item>
      <van-tabbar-item to="/cart" icon="shopping-cart-o">购物车</van-tabbar-item>
      <van-tabbar-item to="/myself" icon="user-o">我的</van-tabbar-item>
    </van-tabbar>
  </div>
</template>
<script>
export default {
  data(){
    return{
      active:''
    }
  },
  watch:{
    $route:{
      handler:function(newval,oldval){
        // console.log(newval);
        this.active = newval.path
      },
      immediate:true
    }
  }
}
</script>
<style lang="scss">

</style>
